package com.tang.excel.oci.mapper;

import com.tang.excel.oci.domain.Product;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Tang
 * @classname ProductMapper
 * @description [  ]
 * @date 2021/3/24 16:22
 */
public interface ProductMapper {
    @Insert(value = {
            "<script>",
            "insert into production_statistic values ",
            "<foreach item = 'item' collection = 'productList' separator = ','>",
            "(null ,#{item.date},#{item.kohSum},#{item.cl2Sum},#{item.hclSum},#{item.naoclSum},",
            "#{item.kohCompany},#{item.kohShip},#{item.kohHengyang},#{item.kohFactory},#{item.kohInventory},",
            "#{item.operateTime},#{item.operator})",
            "</foreach>",
            "</script>"
    })
    void batchInsert(@Param("productList") List<Product> productList);
}